package bankrate;

import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

/**
 * @Author admin
 * @Date 2019/3/19 14:09
 */
public class WZbank extends Bank {
    double year;
    public WZbank(){

    }
    public WZbank(int money,double rate,double year){
        /*
         * 调用父类的构造方法*/
        super(money,rate);
        this.year=year;
    }
    @Override
    public double computerInterest(){
        super.year=(int) year;
        double day  = year-super.year;
        double days=day;
        while (days<1&days!=0){
            day*=10;
            days=day-(int)day;
        }
        double yearInter=super.computerInterest();
        double dayInter=day*money*0.0002;
        System.out.println(money+"元存在温州银行，"+super.year+"年"+day+"天，利息是："+(yearInter+dayInter));
        return  yearInter+dayInter;
    }

}
